<?php

namespace app\merchants\services;

class BaseService
{
    /**
     * @throws \yiqiniu\extend\exception\ApiException
     */
    protected function checkWmsResult($result)
    {
        if ($result['result']) {
            return $result['data'];
        }
        api_exception(API_ERROR, $result['msg']);
    }

    /**
     * 生成前台扫描链接
     * @param string $content 生成内容
     */
    protected function makeQrcodeUrl(string $content): string
    {
        return domain() . '/qrcode?data=' . base64_encode($content);
    }
}